home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Compilers⁄Interps
/
kevoSource
/
tasks.h
< prev
Wrap
Text File
|
1993-05-12
|
2KB
|
74 lines
/* Kevo -- a prototype-based object-oriented language */
/* (c) Antero Taivalsaari 1991-1993 */
/* Some parts (c) Antero Taivalsaari 1986-1988 */
/* tasks.h: Task management internals */
/*
TaskStruct describes the first fields of task-specific (user) data areas.
Note that if you change the order of these field, the corresponding
ordering in the image file must be changed too.
*/
typedef struct taskStruct TASK;
struct taskStruct {
OBJECT* ctxtObj; /* This field always contains '(=context)' */
CONTEXT* ctxtPtr; /* This field contains the context */
TASK** nextInRobin; /* Next task in round robin chain */
TASK** nextTask; /* Next task in the system */
int** rpStore; /* Return stack pointer temporary storage */
int** fp; /* Frame pointer for blocks */
int priority; /* The priority of the task */
OBJECT* returnStack; /* The return stack */
OBJECT* dataStack; /* The data stack */
OBJECT* contextStack; /* The context stack */
OBJECT* trampoline; /* Interactive execution area */
OBJECT* textBuffer; /* The text input buffer */
int textHead; /* Offset to the latest character within text buffer */
int textTail; /* Offset to the last read character within text buffer */
int endOfFile; /* End of file flag */
OBJECT* infileStack; /* Input file stack */
OBJECT* outfileStack; /* Output file stack */
int infilePtr; /* Input file stack pointer */
int outfilePtr; /* Output file stack pointer */
FILE* infile; /* Current input file */
FILE* outfile; /* Current output file */
FILE* errfile; /* Current error file */
int* window; /* The window of the task (the real type is 'WindowPtr') */
OBJECT* path; /* The search path (not used in current implementation) */
int assigning; /* The assignment counter for to-variables */
OBJECT* errorVector; /* The error handler for the task */
};
/* Primitive operations on tasks */
void yieldTo();
void storeExecEnv();
void loadExecEnv();
TASK** buildTask();
TASK** previousRunningTask();
int isActivated();
void activateTask();
int suspendTask();
int yieldingSuspend();
int deleteTask();
int killTask();
void setTaskBehavior();
void toTaskData();
void toTaskReturn();
void toTaskCtxt();
void resizeDataStack();
void resizeReturnStack();
void resizeContextStack();
OBJECT* getTaskCWD();
void setTaskCWD();